home *** CD-ROM | disk | FTP | other *** search
- Program DEMO;
- {a demonstration of TGRAPH usage for Tandy 1000 mode 9 graphics}
-
- {$m 8000,0,0} { Limiting stack and heap size with this }
- { compiler directive takes care of }
- { protecting screen memory area. }
-
-
- {install the correct TPU depending on which TP version you're using}
- {$IFDEF VER40} Uses TGraph40,Crt; {$ENDIF}
- {$IFDEF VER50} Uses TGraph50,Crt; {$ENDIF}
- {$IFDEF VER55} Uses TGraph55,Crt; {$ENDIF}
- {$IFDEF VER60} Uses TGraph60,Crt; {$ENDIF}
-
- Var k:integer;
- ch:char;
- PicBuff:array [1..1000] of byte; {just an estimate of size needed}
-
- Begin
- Randomize;
-
- SetCrtMode (9,true);
-
- {Draw a bunch of diagonal lines in random colors}
- For k := 1 to 20 do Draw (k*5,1,k*5+80,199,Random(15)+1);
-
- {Make three circles}
- Circle (250,50,20,Green);
- Circle (250,100,20,Red);
- Circle (250,150,20,Yellow);
-
- {Paint the circles with random colors}
- Paint (250,50,Random(15)+1,Green);
- Paint (250,100,Random(15)+1,Red);
- Paint (250,150,Random(15)+1,Yellow);
-
- {Recolor everything on the screen randomly}
- Repeat Recolor (Random(15)+1,Random(15)+1);
- Until Keypressed;
- Ch := ReadKey;
-
- {Do a GetPic of a section of the diagonal lines
- and PutPic it on top of the center circle}
- GetPic (PicBuff,75,80,115,120);
- PutPic (PicBuff,230,80);
-
- {A PutPix on top of the original source of the
- image effectively erases the image}
- PutPix (PicBuff,75,80);
-
- Repeat Until Keypressed;
- Ch := ReadKey;
-
- SetCrtMode (3,true);
- End.
-